using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPBackend.Models
{
    public class User : BaseModel
    {
        [Required]
        [MaxLength(50)]
        public string Username { get; set; }

        [Required]
        [MaxLength(100)]
        public string Password { get; set; }

        public string Gender { get; set; }

        public int DepartmentId { get; set; }

        [MaxLength(50)]
        public string Position { get; set; }

        [MaxLength(20)]
        public string Phone { get; set; }

        [MaxLength(100)]
        public string Email { get; set; }

        public DateTime? HireDate { get; set; }

        [Required]
        public bool Status { get; set; } = true;

        // 继承自BaseModel的字段: Id, CreatedBy, CreatedTime, UpdatedBy, UpdatedTime, IsDeleted

        // 导航属性
        public virtual ICollection<UserRole> UserRoles { get; set; }
    }
}